package com.hyt.it.ogt.ks.enums;

import lombok.Getter;

import java.util.Objects;


/**
 *
 * 人脸核身状态 0 未验证、1成功、2 人工审核-不通过、3 人工审核-通过 4 失败 5 未开启（或-）
 */
@Getter
public enum FaceState {
    NOT_DEVICE(0,"未验证"),
    SUCCESS(1,"成功"),
    MANUAL_NO_PASS(2,"人工审核-不通过"),
    MANUAL_PASS(3,"人工审核-通过"),
    FAILD(4,"失败"),
    NOT_OPEN(5,"未开启");

    private Integer code;
    private String msg;

    FaceState(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String getByCode(Integer code){
        if(Objects.isNull(code)){
            return null;
        }
        for(FaceState state : FaceState.values()){
            if(Objects.equals(code,state.getCode())){
                return state.getMsg();
            }
        }
        return null;
    }
}
